package exe3;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Test {
    public static void main(String[] args) {
        Company company = new Company();
        company.address = "广东深圳";
        company.iphone = "123456789";
        company.companyName = "阿里巴巴";
        company.business = "软件开发设计";
        Scanner input = new Scanner(System.in);
        int choose = 0;
        while (true) {
            System.out.print("1.招聘员工 2.查看公司信息和员工信息 3.辞退员工 4.根据年限涨工资0.退出\n请选择:");
            choose = input.nextInt();

            if (choose == 1) {
                Staff staff = new Staff();
                System.out.print("请输入工号:");
                staff.id = input.nextInt();
                System.out.print("请输入姓名:");
                staff.name = input.next();
                System.out.print("请输入性别:");
                staff.sex = input.next();
                System.out.print("请输入职务:");
                staff.post = input.next();
                System.out.print("请输入薪水:");
                staff.money = input.nextDouble();
                System.out.print("请输入身份证号:");
                staff.number = input.next();
                System.out.print("请输入工作年限:");
                staff.years = input.nextInt();
                company.add(staff);
            } else if (choose == 2) {
                company.show();
            } else if (choose == 3) {
                System.out.println("请输入你要辞退的姓名:");
                String name = input.next();
                company.fire(name);
            } else if (choose == 4) {
//                System.out.println("请输入你的姓名:");
//                String name = input.next();
//                company.aaa(name);
                company.addSalary();
            } else if (choose == 5) {
                Staff staff = company.findTopSal();
                if(staff==null)
                    System.out.println("无人");
                else
                    staff.show();
            } else if (choose == 0) {
                break;
            }
        }
        System.out.println("结束了!!!");
    }
}
